﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace PpSmsSender
{


    public class SmsCommand
    {
        public enum CommandType
        {
            Unknown = 0, Execute, Send
        }
        public Exception Exception;
        public string callbackid;

        public SmsCommand(Action<ModemHandler> command, CommandType type, int priority=8)
        {
            this.Type = type;
            this.Command = command;
            this.Port = null;
            this.Priority = priority;
        }

        public SmsCommand(Action<ModemHandler> command, CommandType type, string port, string sendingnumber, int priority = 8, string callbackid=null)
            : this(command, type, priority)
        {
            this.Port = port;
            this.SendingNumber = sendingnumber;
            this.callbackid = callbackid;
        }

        public int Priority { get; private set; }
        public string Port { get; internal set; }
        public PhoneNumber SendingNumber { get; private set; }
        public CommandType Type { get; private set; }
        public Action<ModemHandler> Command { get; private set; }

        public void Execute(ModemHandler smsHandler)
        {
            this.Command(smsHandler);
        }
    }

}
